/**
 * Created by limeng on 16/6/13.
 */
delegateApp.controller("AssistProposalsCtrl", function ($scope, $http, $rootScope, $controller) {
    $controller("ProposalSearchCtrl", {$scope: $scope, $http: $http});

    $scope.searchMap.assistDepartmentId = $rootScope.delegate.department.id;

    $scope.updateContent = function() {
        $scope.searchMap.pageSize = parseInt($scope.pageSize);
        $scope.searchMap.pageNo = parseInt($scope.pageNo);
        $http.post('/proposal/searchAssist', $scope.searchMap).success(
            function (data) {
                if (data.state == true) {
                    $scope.proposals = data.list;
                    $scope.pageCount = data.pageCount;
                } else {
                    showAlert('查询失败', '原因是:' + data.result);
                }
            }
        ).error(
            function () {
                showAlert('查询失败', '请联系开发者进行维护');
            }
        );
    };
    $scope.updateContent();
});